#include "stdio.h"

int bei(int a,int b)
{
	int m,n,c;
	m=a>b?a:b;
	n=a<b?a:b;

	c=m%n;
	while (c)
	{
		m=n;
		n=c;
		c=m%n;
	}
	return a/n*b;
	
}

main()
{
	int i,j,k;
	int n,num;
	unsigned int shu[1000000];
	unsigned int min;

	scanf("%d",&num);
	for (k=1;k<=num;k++)
	{
		scanf("%d",&n);
		memset(shu,0,sizeof(shu));
		for (i=1;i<=n;i++) scanf("%d",&shu[i]);
		min=1;
		for (i=1;i<=n;i++)
		{
			min=bei(min,shu[i]);
		}
		printf("%d\n",min);

		
	}
	
}
